﻿@{
	Script.Require("jQuery").AtFoot();
    Style.Require("Textsize").AtFoot();
}

<span class="texttools">
	<span>Text tools:</span>
	<a href="#" class="increaseFont">@T("Increase")</a>
	<a href="#" class="decreaseFont">@T("Decrease")</a>
	<a href="#" class="resetFont">@T("Reset")</a>
</span>

@using(Script.Foot()) {
<script type="text/javascript">
(function ($) {
	$(document).ready(function () {
		// Reset Font Size
		var fontSize = $('#layout-content').css('font-size');
		$(".resetFont").click(function () {
			$('#layout-content').css('font-size', fontSize);
		});
		// Increase Font Size
		$(".increaseFont").click(function () {
			var currentFontSize = $('#layout-content').css('font-size');
			var currentFontSizeNum = parseFloat(currentFontSize, 10);
			var newFontSize = currentFontSizeNum * 1.2;
			$('#layout-content').css('font-size', newFontSize);
			return false;
		});
		// Decrease Font Size
		$(".decreaseFont").click(function () {
			var currentFontSize = $('#layout-content').css('font-size');
			var currentFontSizeNum = parseFloat(currentFontSize, 10);
			var newFontSize = currentFontSizeNum * 0.8;
			$('#layout-content').css('font-size', newFontSize);
			return false;
		});
		$("body").keyup(function (event) {
			if (event.altKey) {
				if (event.which == '73') {
					//Increase
					$(".increaseFont").click();
				} else if (event.which == '68') {
					//Decrease
					$(".decreaseFont").click();
				} else if (event.which == '82') {
					//Reset
					$(".resetFont").click();
				}
			}
		});
	});
})(jQuery);
</script>
}

